/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package drivetrain;

import java.util.ArrayList;
/**
 * Gearbox for InternalCombustionPropulsionUnit. Contains the gearratios and gearshifttimes.
 * @author Vekjeft
 */
public class GearBox{
    private ArrayList<Float> gearRatios;  // Gear ratio of each gear
    private float gearShiftTime;  // Time required to change gear, method to delay gearshift must be implemented

    /**
     * 
     * @return
     */
    public int getNumberOfGears(){
    return gearRatios.size();
    }
    /**
     * 
     */
    public GearBox(){
    gearRatios = new ArrayList<Float>();
    }
    /**
     * 
     * @param gear
     * @param ratio
     */
    public void addGearRatio(int gear,float ratio){
    gearRatios.add(gear, ratio);
    }
    /**
     * 
     * @param gear
     * @return
     */
    public float getRatioFromGear(int gear){
    return gearRatios.get(gear);
    }
    /**
     * 
     * @param gearShiftTime
     */
    public void setGearShiftTime(float gearShiftTime){
    this.gearShiftTime = gearShiftTime;
    }
    /**
     * 
     * @return
     */
    public float getGearShiftTime(){
    return gearShiftTime;
    }
    /**
     * 
     * @return
     */
    public ArrayList<Float> getGearRatios(){
    return gearRatios;
    }
}
